
import SysMenuService from "../../service/sys/SysMenuService";
import Result from "../../vo/Result";


const { Router } = require('express')

const router = Router()

//获取树形结构的菜单
router.get('/api/sys/menu/tree', function (req, res) {
  return Result.ok(res,SysMenuService.tree())
})

router.get('/api/sys/menu/one', function (req, res) {
  return Result.ok(res,SysMenuService.one(req.query.id))
})

router.get('/api/sys/menu/list', function (req, res) {
  return Result.ok(res,SysMenuService.list(req.body))
})

router.post('/api/sys/menu/update', function (req, res) {
  return Result.ok(res,SysMenuService.update(req.body))
})

router.delete('/api/sys/menu/delete', function (req, res) {
  return Result.ok(res,SysMenuService.delete(req.query.id))
})

module.exports = router
